class HouseholdsController < ApplicationController
  def index
    @household_pages, @households = paginate :households, :per_page => 10
  end

  def new
    @household = Household.new params[:household]
  end

  def create
    new
    if @household.save
      flash[:notice] = "Household created successfully"
      redirect_to :action => 'index'
    end
  end

  def show
    @household = Household.find params[:id]
  end

  def edit
    @household = Household.find params[:id]
  end

  def update
    edit
    if @household.update_attributes(params[:household])
      flash[:notice] = "Household edited successfully"
      redirect_to :action => 'show'
    end
  end

  def destroy
    Household.delete params[:id]
    flash[:notice] = "Houshold destroyed successfully"
    redirect_to :action => 'index'
  end
end
